/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow strict-local
 */

import React from 'react';
import {StatusBar, NativeModules} from 'react-native';
import WebView from 'react-native-webview';

const {StatusBarManager} = NativeModules;
const STATUSBAR_HEIGHT = Platform.OS === 'ios' ? 20 : StatusBarManager.HEIGHT;

const App: () => React$Node = () => {
  return (
    <>
      {/*<StatusBar translucent={true} backgroundColor="transparent"/>*/}
      <WebView
        injectedJavaScript={`(function() {
            window.postMessage = function(data) {
              window.ReactNativeWebView.postMessage(data);
            };
          })()`}
        // style={{marginTop: STATUSBAR_HEIGHT}}
        onMessage={(event) => {
          console.log(event.nativeEvent.data);
        }}
        source={{
          uri: 'file:///android_asset/web/index.html'
        }}
      />
    </>
  );
};
export default App;
